
<div class="ModuleBlock">
<h1>
<label>Search & Add Contacts</label>

</h1>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td class="wht_box_bg_m7"><table width="97%" border="0" cellspacing="0" cellpadding="0" align="center">
              <tr>
                <td class="gray_strip" height="6"></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td valign="top"><table width="97%" border="0" cellspacing="0" cellpadding="0" align="center">
                    <tr>
                      <td style="padding-left:75px;color:#F00;" id="errorMsg" height="18">&nbsp;</td>
                    </tr>
                    <tr>
                      <td valign="top"><table width="97%" border="0" align="center" cellpadding="5" cellspacing="0">

                          <tr>
                            <td width="37" align="left"><strong>Name</strong></td>
                            <td width="10" align="center">:</td>
                            <td width="1048" align="left"><div class="textfield_bg_5">
                                <input type="text" name="sindividual" id="sindividual" value="" class="textfield_4"  onkeypress="executeLogin(event);" />
                              </div></td>
                          </tr>
                          <tr>
                          <td colspan="2">&nbsp;</td>
                          <td><strong>Note: </strong>Please search with First Name</td>
                          </tr>
                          
                          <!--<tr>
<td width="183" align="left" valign="top">Search Account Name</td>
<td width="3" align="left" valign="top">:</td>
<td width="365" align="left" valign="top" ><div class="textfield_bg_5">
<input type="text" name="sname" id="sname" value="" class="textfield_4" />
</div><span id="errorMsg1" style="color:#F00;"></span></td>
</tr>-->
                          <tr>
                            <td width="37" height="40" align="right">&nbsp;</td>
                            <td width="10">&nbsp;</td>
                            <td width="1048" align="left" valign="bottom" >
							<a class="Button" href="javascript:void(0);" onclick="searchField();"><span>Search</span></a>
							</td>
                          </tr>
                        </table></td>
                    </tr>
                    <tr>
                      <td align="left" id="listContent"></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                    </tr>
                    <tr>
                      <td align="left"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
                          <tr>
                            <td>&nbsp;</td>
                          </tr>
                          <tr>
                            <td>&nbsp;</td>
                          </tr>
                        </table></td>
                    </tr>
                    <tr>
                      <td align="left">&nbsp;</td>
                    </tr>
                  </table></td>
              </tr>
            </table></td>
        </tr>

      </table>


<div class="clear"></div>
</div>
<script type="text/javascript">
function executeLogin(e)
{ 
		if(window.event)
		keyPressed = window.event.keyCode; // IE hack
		else
		keyPressed = e.which; // standard method
	if(keyPressed == 13){
		searchField();
	}
}


function searchField()
{
	if(trim($('#sindividual').val()) == '')
	{
		$('#errorMsg').html("Plese enter atelase a character.");
		return false;	
	} 
		//,stype:$('#stype').val()
		$('#errorMsg').html('');
		$.ajax({
			   type: "POST",
			   dataType: "json",
			   url: "/contacts/index/send-search",
			   data: {sindividual:$('#sindividual').val(),searchType:$('#stype').val()},
			   success: function(data){
						$('#listContent').html(data.output);
			   }
		});
}
</script>

